package com.wyu.blog.dao;

import com.wyu.blog.entity.Comment;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
@Qualifier("dbSqlSessionTemplate")
public interface CommentMapper {

    /**
     * 查询所有评论信息
     * @return
     */
    List<Comment> selectAllComment();

    Comment selectComment(Integer commentId);

    Integer deleteCommentById(Integer commentId);

    List<Comment> selectCommentById1(Integer articleId);

    List<Comment> selectCommentById2(Integer articleId);

    Integer selectCommentNum(Integer articleId);

    Integer insertComment(Comment comment);

    Integer updateChildCommentNum(Comment comment);

    Integer insertChildComment(Comment comment);

    List<Comment> selectChildComments(Integer parentCommentId);

//    Integer selectChildCommentNum(Integer parentCommentId);

    Integer updateLikeNum(Comment comment);
}
